﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Plan;
using System.Threading.Tasks;
using System.Threading;

namespace PlanInterfejs
{
    public class PlanView
    {
        SimulatedAnnealingAlgoritm algorithm = new SimulatedAnnealingAlgoritm();

        public SimulatedAnnealingAlgoritm Algorithm
        {
            get { return algorithm; }
            set
            {
                if (value == null)
                    throw new ArgumentNullException();
                algorithm = value;
            }
        }
        public void GeneratePlan()
        {
            var wrapper = new AlgorithmParametersWrapper();
            ScheduleInstance instance = wrapper.GetAlgInstance();
            ScheduleSolution solution = algorithm.Solve(instance);
            wrapper.UpdateDatabase(solution);
        }

    }
}
